package com.atguigu.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.atguigu.service.HelloService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author: ljg
 * @Date: 2024/10/8 4:42 PM Tuesday
 * @Description:
 */

@RequestMapping("/hello")
@Controller
public class HelloController {
    @Reference
    private HelloService helloService;

    @RequestMapping("{name}")
    @ResponseBody
    public String getName(@PathVariable String name) {
        String s = helloService.sayHello(name);
        return s;
    }
}
